<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set system resource limits</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.posix-setrlimit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_setrlimit</h1>
  <p class="verinfo">(PHP 7)</p><p class="refpurpose"><span class="refname">posix_setrlimit</span> &mdash; <span class="dc-title">Set system resource limits</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.posix-setrlimit-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_setrlimit</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$resource</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$softlimit</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$hardlimit</code></span>
   ) : <span class="type">bool</span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>posix_setrlimit()</strong></span> sets the soft and hard limits for a
   given system resource.
  </p>
  
<p class="para">
  Each resource has an associated soft and hard limit.  The soft
  limit is the value that the kernel enforces for the corresponding
  resource.  The hard limit acts as a ceiling for the soft limit.
  An unprivileged process may only set its soft limit to a value
  from 0 to the hard limit, and irreversibly lower its hard limit.
</p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-setrlimit-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">resource</code></dt>

     <dd>

      <p class="para">
       The
       <a href="posix.constants.setrlimit.html" class="link">resource limit constant</a>
       corresponding to the limit that is being set.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">softlimit</code></dt>

     <dd>

      <p class="para">
       The soft limit, in whatever unit the resource limit requires, or
       <strong><code>POSIX_RLIMIT_INFINITY</code></strong>.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">hardlimit</code></dt>

     <dd>

      <p class="para">
       The hard limit, in whatever unit the resource limit requires, or
       <strong><code>POSIX_RLIMIT_INFINITY</code></strong>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-setrlimit-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.posix-setrlimit-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member">man page SETRLIMIT(2)</li>
    <li class="member"><span class="function"><a href="posix_getrlimit.html" class="function" rel="rdfs-seeAlso">posix_getrlimit()</a> - Return info about system resource limits</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>